<?php

use yii\db\Migration;

class m160114_101546_create_company_branch_department extends Migration
{
    public function up()
    {
        $this->createTable('company', [
            'id' => $this->primaryKey(),
            'name' => $this->string(100),
            'email' => $this->string(100),
            'address' => $this->string(),
            'created_at' => $this->dateTime(),
        ]);
        $this->createTable('branch', [
            'id' => $this->primaryKey(),
            'name' => $this->string(100),
            'address' => $this->string(),
            'created_at' => $this->dateTime(),
        ]);
        $this->createTable('department',[
            'id' => $this->primaryKey(),
            'name' => $this->string(100),
            'created_at' => $this->dateTime(),
        ]);
    }

    public function down()
    {
        $this->dropTable('company');
        $this->dropTable('branch');
        $this->dropTable('department');
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
